#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include <QMainWindow>
#include <QLabel>
#include <QThread>
#include <QObject>
#include "qsnake.h"


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

    //通过键盘按钮操作snake的方向和加速
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);
public slots :
    //主窗口PlaySnake请求更新样式接收槽
    void updataStyle(showType *lab, QString style);
    //PlaySnake请求更新显示节点位置样式大小
    void updataNode(showType *lab, QString style,int x,int y ,int step);
    //更新frog
    void updataFrog(int x ,int y,int step);
    //信息码
    void dealSnakeMsg(int code);

private:
    showType *showtype;
    showType *area;
    PlaySnake *playsnake;
    snakeType *snake;
};

#endif // MAINWINDOW_H

